package shapes.shapes2D 
{
	import flash.display.Graphics;
	import flash.display.Sprite;
	/**
	 * @author Nicolas Barradeau
	 * http://en.nicoptere.net
	 */
	public class Square extends BaseShape
	{
		private var _size:Number;
		public function Square( x:Number, y:Number, size:Number ) 
		{
			
			this.x = x;
			this.y = y;
			_size = size;
			
		}
		
		public function draw( graphics:Graphics = null ):void
		{
			if ( graphics == null )
			{
				
				graphics = this.graphics;
				graphics.lineStyle( strokeWidth, strokeColor, strokeAlpha );
				graphics.beginFill( fillColor, fillAlpha );
				graphics.drawRect( - size * .5, - size * .5, size, size  );
				
			}
			else 
			{
				graphics.drawRect( x - size * .5, y - size * .5, size, size );
			}
		}
		
		public function get size():Number { return _size; }
		
		public function set size(value:Number):void 
		{
			_size = value;
		}
		
	}

}